Lesson 6 Exercise 3: Using Macros

In this exercise you will tag primitives in a symbol (in the Symbol Editor) and add macros to an object view (in the model) in order to display the object name and to change the color of part of the symbol.

Try to complete the following steps on your own. If you need help, click the step to jump to a set of more detailed steps.

1	Start METIS and Open Symbol File

Open the symbol file MySymbolL6_1.svg, created in an earlier exercise.

2	Create a New Text Box

Create a new text box to display the object name in the model.

3	Tag Primitives

Set Tag on the new text primitive, naming it text, and for the icon representing an organizational structure, naming it icon; then save the symbol.

4	Create Exercise Model

Create a new model called MyExerciseL6_3 based on the Training template.

5	Connect Symbol to Object

Connect the symbol you created in MySymbolL6_1, named Organization1, to the top object in the Organization container.

6	Edit Macros

Use Edit Macros to change the color of the primitives tagged icon, on the top object in the Organization container.

7	Save the Model and Close METIS

8	Practice on Your Own (Optional)

Start METIS and Open Symbol File

To begin this exercise, start METIS and open the symbol file MySymbolL6_1 as follows:

1	Minimize your web browser and any other application you have open (except this window) to see your desktop.

2	Double-click the METIS icon [image] to launch METIS.

3	In the dialog box, click Existing File.

4	Click in the Files of type field and select Symbol files(*.svg).

5	Click the file MySymbolL6_1.svg (you may need to navigate to where you saved it) and click Open.

6	Position this Exercise window so that you have a good view of the Symbol Editor window.

Create a New Text Box

Create a new text box to display the object name in a model:

1	Click the Text tool [image].

2	Click and drag the mouse diagonally to outline a text box covering the middle section of the symbol.

3	Right-click the text box, and select Edit Text. In the dialog box, enter the text Text. When you are done, click OK.

Example

Tag Primitives

Tag the text primitive to make it possible to display the object name in the model. Tag another primitive to make it possible to change its color in the model.

1	Right-click on the text primitive Text and select Set Tag.

2	In the tag window, enter tag text and click OK. Note that text is a predefined tag name. METIS uses a built in macro to display the label (usually the name property) of an object view for text primitives tagged this way.

3	Select the group of rectangles representing an organizational structure, and then click the Ungroup tool [image].

4	Right-click one of the primitives that you ungrouped and choose Set Tag. Note that the primitives must remain selected.

5	In the tag window, enter tag icon and click OK.

6	If desired, click the Group tool [image] to group the primitives again. Ensure that only the rectangles, the line, and the polyline are selected before you click the Group tool [image].

7	Click the File menu and choose Save.

Create Exercise Model

Complete the following steps to create a new model file based on an example template:

1	Click the File menu and choose New.

2	In the dialog box, click the Model From Template option.

3	In the template list, click Training, and then click OK.

4	In the file dialog box, enter MyExerciseL6_3 for the filename and click Save.

Connect Symbol to Object

Complete the following steps to connect the symbol to objects in the model:

1	Right-click the Organization container, point to Zoom, and then choose Zoom To.

2	Click the Symbol tab in the left pane of the METIS window.

3	In the Symbol tree that displays, expand the Loaded Symbols palette and find the symbol named Organization1. Select the symbol.

4	Drag the symbol named Organization1 from the symbol preview area, and then drop it on the top object in the container. Note that the Name property is automatically displayed on the object view.

5	To ensure the symbol has the correct aspect ratio, right-click the object, point to Symbol, and then click Fit To Aspect Ratio.

6	If necessary, click the Decrease Text Size tool [image] or Increase Text Size tool [image] until the name is displayed with an appropriate size.

Example

Edit Macros

Add a macro to the selected object view in order to change the color of the tagged primitive, icon.

1	Right-click the top object in the Organization container, point to Symbol, and then choose Edit Macros.

2	Click the Tag list and select tag icon from the list.

3	Click the Graphical property list and select fillcolor from the list.

4	In the Macro box, enter “red”.

5	Click OK to apply the macro to the selected object view and to close the macro window.

Example

Save the Model and Close METIS

Complete the following steps to complete the lesson:

1	From the File menu, click Save.

2	From the File menu, click Exit.

3	Close this window and maximize your browser to continue with the course.

Practice on Your Own (Optional)


Practice on Your Own (Optional)

Use the Increase Text Size [image] and Decrease Text Size tools [image] in the Model Editor to experiment with changing the size of the text that displays on your symbol when applied to an object in a model. Alternately, edit the properties of the text box in the Symbol Editor to change the default font size. Right-click the text box, choose Properties, and click the Font tab.

Experiment with editing macros for the standard symbols in this model using the standard tags. For example, right-click product P2010, point to Symbol, and then choose Edit Macros. Experiment with modifying the graphical properties for the standard tags and view the resulting changes to the symbol.

For more detailed information, press F1 from the Edit Macros dialog box. Scroll to the bottom of the help topic and click on the Related Topics.


Create a New Text Box

Back to Exercise


Symbol Connected to Object

Back to Exercise


Edit Macros

Back to Exercise